import sys
from base64 import encode
from idlelib.iomenu import encoding

#
#file = sys.stdout
#file.write('hello')

#print('world')

# file = open('test.txt','r')
# print(file.read(3))

#不需要 写close
# with open('test.txt','r',encoding='utf-8') as file2:
#     list2 = file2.readlines()
#     print(list2)
#
# #覆盖写，默认文件为空
# str = "day day up"
# with open('test.txt','w',encoding='utf-8') as file3:
#     file3.write(str)
#
# list3 = ['hello11','world22']
# with open('test.txt','a',encoding='utf-8') as file4:
#     file4.writelines(list3)





file = open('test.txt','rb')
print(file.read(3))
print(file.tell())
print(file.seek(3,0))